<%--
  Created by IntelliJ IDEA.
  User: WIzarder
  Date: 2021/5/30
  Time: 16:57
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
        <h1>这是scope页面</h1>
        <%
            pageContext.setAttribute("key1","value1");
            request.setAttribute("key2","value2");
            session.setAttribute("key3","value3");
            application.setAttribute("key4","value4");
        %>
        pageContext是否有值：<%=pageContext.getAttribute("key1")%><br/>
        request是否有值：<%=request.getAttribute("key2")%><br/>
        session是否有值：<%=session.getAttribute("key3")%><br/>
        application是否有值：<%=application.getAttribute("key4")%><br/>
<%--        <%--%>
<%--            request.getRequestDispatcher("/scope2.jsp").forward(request,response);--%>
<%--        %>--%>
      <jsp:forward page="scope2.jsp"></jsp:forward><%--  等同上面的代码--%>
</body>
</html>
